#ifndef THREAD_H
#define THREAD_H


#include <stdlib.h>
#include <pthread.h>
#ifdef WIN32
#include <config.h>
#endif
#include <unistd.h>


struct thrd_lock
{
  int lastThread;
  pthread_t threads [16];
  int locks[16];
  int mutex_lock;
  pthread_mutex_t mutex;
}; //these are per-thread ref counting locks...

struct thrd_lock *thrd_lock_new();

void thrd_lock_free(struct thrd_lock *lock);

void thrd_lock(struct thrd_lock *lock);

void thrd_unlock(struct thrd_lock *lock);


	
#endif
